const { defineConfig } = require('@vue/cli-service')
const webpack = require('webpack')

module.exports = defineConfig({
  publicPath: '/reward/',
  transpileDependencies: true,

  chainWebpack: config => {
    config
        .plugin('define')
        .tap(args => {
          Object.assign(args[0], {
            __VUE_OPTIONS_API__: true,
            __VUE_PROD_DEVTOOLS__: false,
            __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
          })
          return args
        })
  },

  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:86',  // 目标服务器的地址
        changeOrigin: true,  // 是否改变源
        pathRewrite: {
          '^/api': ''  // 替换路径中以 `/api` 开头的部分
        }
      }
    }
  }
})
